Skip to content

fix(landing): render proper 404 for invalid /models and /integrations routes#4232

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-404-page
Apr 19, 2026
Merged

fix(landing): render proper 404 for invalid /models and /integrations routes#4232
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-404-page

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Add scoped not-found.tsx for /models and /integrations so invalid slugs (e.g. /models/anthropic/123, /integrations/rand) render the styled 404 instead of crashing with "Application error: a client-side exception has occurred"
  • Root cause: both sections' page.tsx use dynamicParams = false and call notFound(), which fell back to app/not-found.tsx. That file renders its own <Navbar> + <AuthBackground fixed inset-0> on top of the section layout's <Navbar> + <Footer>, duplicating client hooks and conflicting positioning
  • The new scoped 404s inherit the section Navbar/Footer from the layout and render only the centered message + "Return to Home" CTA

Type of Change

  • Bug fix

Testing

Tested manually — visiting /models/anthropic/123, /models/not-a-real-provider, and /integrations/rand now renders the styled 404. Valid URLs still render normally; root 404 behavior unchanged.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Apr 19, 2026

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 19, 2026 4:10am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 19, 2026

PR Summary

Low Risk
Low risk: adds two isolated not-found.tsx components to change error rendering for invalid slugs, without touching routing logic, data access, or auth.

Overview
Invalid routes under /models and /integrations now render dedicated, section-scoped 404 pages instead of falling back to the global app/not-found.tsx.

The new not-found.tsx files display the centered “Page not found” message and a “Return to Home” CTA while inheriting the surrounding landing layout (avoiding duplicated global 404 UI like the navbar/background).

Reviewed by Cursor Bugbot for commit 8ad41a2. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 19, 2026

Greptile Summary

This PR adds scoped not-found.tsx files under (landing)/integrations/ and (landing)/models/ so that notFound() calls in those route segments (triggered by dynamicParams = false on invalid slugs) are caught by the nearest boundary rather than falling back to app/not-found.tsx. The root 404 previously duplicated the <Navbar> and <AuthBackground> on top of the section layout's own <Navbar>/<Footer>, causing a crash. The new files correctly delegate chrome to the existing section layouts and render only the centered 404 message.

Confidence Score: 5/5

Safe to merge — minimal, focused fix with no logic issues or regressions

Both new files are pure server components with no state, no data-fetching, and no side effects. The CSS variables used by AUTH_PRIMARY_CTA_BASE are globally defined in globals.css so they resolve correctly inside the landing layout context. Next.js correctly bubbles notFound() to the nearest not-found.tsx boundary, so the scoped files will intercept all invalid slug requests for their respective sections. No P1 or P0 issues found.

No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/(landing)/integrations/not-found.tsx New scoped 404 page for invalid /integrations slugs; correctly inherits Navbar/Footer from IntegrationsLayout and avoids duplicate layout conflict
apps/sim/app/(landing)/models/not-found.tsx New scoped 404 page for invalid /models slugs; correctly inherits Navbar/Footer from ModelsLayout and avoids duplicate layout conflict

Sequence Diagram

sequenceDiagram
    participant User
    participant Next as Next.js Router
    participant Page as [slug]/page.tsx<br/>(dynamicParams=false)
    participant ScopedNF as integrations/not-found.tsx<br/>(NEW)
    participant Layout as IntegrationsLayout<br/>(Navbar + Footer)
    participant RootNF as app/not-found.tsx<br/>(BEFORE — duplicate Navbar)

    User->>Next: GET /integrations/rand
    Next->>Page: render page
    Page-->>Next: notFound() thrown

    Note over Next,RootNF: BEFORE this PR
    Next->>RootNF: bubble to root not-found
    RootNF->>Layout: layout wraps → duplicate Navbar crash

    Note over Next,ScopedNF: AFTER this PR
    Next->>ScopedNF: caught by nearest not-found.tsx
    Layout->>ScopedNF: wraps with Navbar + Footer (correct)
    ScopedNF-->>User: styled 404 with single Navbar
Loading

Reviews (2): Last reviewed commit: "fix(landing): render proper 404 for inva..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/fix-404-page branch from b3e9bf0 to 8ad41a2 Compare April 19, 2026 04:10
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8ad41a2. Configure here.

Comment thread apps/sim/app/(landing)/models/not-found.tsx
@waleedlatif1 waleedlatif1 merged commit 951fbd4 into staging Apr 19, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/fix-404-page branch April 19, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant